﻿<%@ Page Title="Opret en ny film" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="CreateNewMovie.aspx.cs" Inherits="cinetoona.CreateNewMovie" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    </asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">        
            <div id="ResWrap">
            <h2>Create/EDit Movies</h2>
                <asp:Label ID="TitleLabel" runat="server" Text="Label">Title:</asp:Label><br />
                <asp:TextBox ID="TitleTextBox" runat="server" Width="272px"></asp:TextBox><br />
  
                <asp:Label ID="LaunchLabel" runat="server" Text="Launch date:"></asp:Label><br />
                <asp:TextBox ID="LaunchDateTextBox" runat="server" Width="272px"></asp:TextBox><br />

                <asp:Label ID="LengthLabel" runat="server" Text="Movie Lenght:"></asp:Label><br />
                <asp:TextBox ID="LengthTextBox" runat="server" Width="272px"></asp:TextBox><br />

                <asp:Label ID="PrisLabel" runat="server" Text="Price:"></asp:Label><br />
                <asp:TextBox ID="PriceTextBox" runat="server" Width="272px"></asp:TextBox><br />
                <asp:Label ID="Resume" runat="server" Text="Resume:"></asp:Label><br />                
            
                <asp:TextBox ID="ResumeTextbox" runat="server" Rows="6" Width="272px" 
                    Height="70px" TextMode="MultiLine"></asp:TextBox>
                    <br />

                <asp:Label ID="DescriptionLabel" runat="server" Text="Description:"></asp:Label><br />                
            
                <asp:TextBox ID="DescriptionTextBox" runat="server" Rows="6" Width="272px" 
                    Height="125px" TextMode="MultiLine"></asp:TextBox>

                <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                    ContextTypeName="cinetoona.DataAccessDataContext" EntityTypeName="" 
                    Select="new (Title, Resume, Runtime, Release_Date, Price)" 
                    TableName="Movies" EnableDelete="True">
                </asp:LinqDataSource>
                <br />
                <asp:RegularExpressionValidator ID="DateRegularExpressionValidator" 
                    runat="server" ControlToValidate="LaunchDateTextBox" 
                    ErrorMessage="DateFormat dd-mm-yyyy" 
                    ValidationExpression="((0[1-9]|[12][0-9]|3[01])[-]((0[1-9]|1[012])[-])?)?(19|20)\d\d" 
                    ValidationGroup="1"></asp:RegularExpressionValidator>

                    <table style="width: 73%;">
                    <tr>
                        <td>
                <asp:Button ID="CreateMovieBt" runat="server" Text="Create" Width="84px" 
                    onclick="CreateMovieBt_Click" ValidationGroup="1" />
             </td>
             <td>
                <asp:Button ID="UpdateMovieBt" runat="server" Text="Update" Width="85px" 
                    onclick="UpdateMovieBt_Click" ValidationGroup="1" />
                    </td>
            <td>
                <asp:Button ID="DeleteMovieBt" runat="server" Text="Delete" Width="85px" 
                    onclick="DeleteMovieBt_Click" ValidationGroup="1" />
            
                        </td>
                        </tr>
                        
                </table>
                <br />
                <asp:Label ID="selectedIdLable" runat="server" Text="SelectedID" 
                    Visible="False"></asp:Label>
                <br />
&nbsp;<div id="botPic"><img alt="Cinetoona" src="Images/cinema.jpg" /></div>

            </div>
           <div id="CreateBooking">
        <h2>Movies:</h2><br />
               <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                   DataSourceID="LinqDataSource1" 
                   onselectedindexchanged="GridView1_SelectedIndexChanged" AllowPaging="True" 
                   CellPadding="4" ForeColor="#333333" GridLines="None">
                   <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
               <Columns>
                   <asp:CommandField ShowSelectButton="True" />
                   <asp:BoundField DataField="Title" HeaderText="Title" ReadOnly="True" 
                       SortExpression="Title" />
                   <asp:BoundField DataField="Runtime" HeaderText="Runtime" ReadOnly="True" 
                       SortExpression="Runtime" />
                   <asp:BoundField DataField="Release_Date" HeaderText="Release Date" 
                       ReadOnly="True" SortExpression="Release_Date" 
                       DataFormatString="{0:MM/dd/yyyy}" />
                   <asp:BoundField DataField="Price" HeaderText="Price" ReadOnly="True" 
                       SortExpression="Price" />
               </Columns>
                   <EditRowStyle BackColor="#999999" />
                   <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                   <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                   <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                   <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                   <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                   <SortedAscendingCellStyle BackColor="#E9E7E2" />
                   <SortedAscendingHeaderStyle BackColor="#506C8C" />
                   <SortedDescendingCellStyle BackColor="#FFFDF8" />
                   <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            <br />
            Movie Description
            <br />
               <asp:TextBox ID="TextBoxDescrip" runat="server" Height="90px" Width="350px" 
                   ReadOnly="True" TextMode="MultiLine"></asp:TextBox>

            
    </div>
            
</asp:Content>
